package com.itheima.config;

import com.itheima.interceptor.TokenInterceptor01;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * TODO
 *
 * @Author mr.wu
 * @Data #{DATE} #{TIME}
 */
@Configuration
public class InterceptorConfig01 implements WebMvcConfigurer {

    @Autowired
    private  TokenInterceptor01 tokenInterceptor01;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
                registry.addInterceptor(tokenInterceptor01)
                        .addPathPatterns("/**")
                        .excludePathPatterns("/login");

    }
}
